package com.veer.shop.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.veer.shop.annotation.ApiControllerLog;
import com.veer.shop.annotation.ApiSecured;
import com.veer.shop.config.ApiUrlConfig;
import com.veer.shop.pojo.ResponseData;
import com.veer.shop.service.impl.admin.ImportServiceImpl;

/**
 * 系统数据导入管理  控制器
 * 
 * @author WangBin
 * 2020年12月30日-下午5:52:04
 */
@RestController
public class ImportController {
	
	@Autowired
	private ImportServiceImpl importServiceImpl;
	
	/**
	 * 数据导入
	 */
	@ApiSecured
	@ApiControllerLog(description = "文件数据导入")
	@RequestMapping( path = ApiUrlConfig.API_DATA_IMPORT_URL, method = RequestMethod.POST)
	public ResponseData<?> upload(@RequestParam("file") MultipartFile multipartFile, @RequestParam("scene") String scene)
	{
		return importServiceImpl.upload(multipartFile, scene);
	}
}
